<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Issue Sample Note to Factory</title>

</style>
 <#include "/ftl/common.ftl"/>
</head>

<body>
<button onclick="downloadReport()">Generate PDF Report</button>
<form action="confirmFabric.do" method="post" > <fieldset>
			<legend>Sample Note Report to Factory</legend>
			<table>
			<tr>
				<td>
				<label for="sampleNoteReport.supplier">Suppiler :</label></td><td>
				<input type="text" name="sampleNoteReport.supplier" id="sampleNoteReport.supplier" value="${sampleNoteReport.supplier}" class="text ui-widget-content ui-corner-all" />
				</td>
				<td>
				<label for="sampleNoteReport.user">User :</label></td><td>
				<input type="text" name="sampleNoteReport.user" id="sampleNoteReport.user" value="${sampleNoteReport.user}" class="text ui-widget-content ui-corner-all" />
				</td>
				<td>
				<label for="sampleNoteReport.indentno">Indent Number :</label></td><td>
				<input type="text" name="sampleNoteReport.indentno" id="sampleNoteReport.indentno" value="${sampleNoteReport.indentno}" class="text ui-widget-content ui-corner-all" />
				</td>
				<td>
				<label for="sampleNoteReport.issuedate">Issue Date :</label></td><td>
				<input type="text" name="sampleNoteReport.issuedate" id="sampleNoteReport.issuedate" value="" class="text ui-widget-content ui-corner-all" />
				</td>
			</tr>
			<tr>
				<td>
				<label for="sampleNoteReport.style_detail_units">Order Units :</label></td><td>
				<input type="text" name="sampleNoteReport.style_detail_units" id="sampleNoteReport.style_detail_units" value="${sampleNoteReport.style_detail_units}" class="text ui-widget-content ui-corner-all" />
				</td>
				<td>
				<label for="sampleNoteReport.order_duedate">Order Due Date :</label></td><td>
				<input type="text" name="sampleNoteReport.order_duedate" id="datepicker_order" value="" class="text ui-widget-content ui-corner-all ui-state-highlight" />
				</td>
				<td>
				<label for="sampleNoteReport.sample_units">Sample Unit :</label></td><td>
				<input type="text" name="sampleNoteReport.sample_units" id="sampleNoteReport_sample_units" value="" class="text ui-widget-content ui-corner-all ui-state-highlight" />
				</td>
				<td>
				<label for="sampleNoteReport.sample_duedate">Sample Due Date :</label></td><td>
				<input type="text" name="sampleNoteReport.sample_duedate" id="datepicker_sample" value="" class="text ui-widget-content ui-corner-all ui-state-highlight" />
				</td>
			</tr>
			
			<tr>
				<td>
				<label for="sampleNoteReport.styleno">Style Number :</label></td><td>
				<input type="text" name="sampleNoteReport.styleno" id="sampleNoteReport.styleno" value="${sampleNoteReport.styleno}" class="text ui-widget-content ui-corner-all" />
				</td>
				<td>
				<label for="sampleNoteReport.productname">Product Name :</label></td><td>
				<input type="text" name="sampleNoteReport.productname" id="sampleNoteReport.productname" value="${sampleNoteReport.productname}" class="text ui-widget-content ui-corner-all" />
				</td>
				<td>
				<label for="sampleNoteReport.targetprice">Target Price :</label></td><td>
				<input type="text" name="sampleNoteReport.targetprice" id="sampleNoteReport_targetprice" value="" class="text ui-widget-content ui-corner-all ui-state-highlight" />
				</td>
				<td>
				<label for="sampleNoteReport.actualprice">Actual Price :</label></td><td>
				<input type="text" name="sampleNoteReport.actualprice" id="sampleNoteReport.actualprice" value="" class="text ui-widget-content ui-corner-all" />
				</td>
			</tr>
			
			<tr>
				<td>
				<label for="sampleNoteReport.trims_notes">Trims Notes :</label></td><td>
				<input type="text" name="sampleNoteReport.trims_notes" id="sampleNoteReport.trims_notes" value="${sampleNoteReport.trims_notes}" class="text ui-widget-content ui-corner-all" />
				</td>
				<td>
				<label for="sampleNoteReport.fabric_notes">Fabric Notes:</label></td><td>
				<input type="text" name="sampleNoteReport.fabric_notes" id="sampleNoteReport.fabric_notes" value="${sampleNoteReport.fabric_notes}" class="text ui-widget-content ui-corner-all" />
				</td>
				<td>
				<label for="sampleNoteReport.wash_notes">Wash Notes:</label></td><td>
				<input type="text" name="sampleNoteReport.wash_notes" id="sampleNoteReport.wash_notes" value="${sampleNoteReport.wash_notes}" class="text ui-widget-content ui-corner-all" />
				</td>
				<td>
				<label for="sampleNoteReport.sample_requirements">Sample Requirements :</label></td><td>
				<input type="text" name="sampleNoteReport.sample_requirements" id="sampleNoteReport.sample_requirements" value="${sampleNoteReport.sample_requirements}" class="text ui-widget-content ui-corner-all" />
				</td>
			</tr>
			
			</table>
		</fieldset>

tick sample size.

you have  time left to issue Sample Note to factory .
<input type="submit" value="proceed to next step" >
</form>
</body>
<SCRIPT> 
$(function() {
		$( "#datepicker_order" ).datepicker();
		$( "#datepicker_sample" ).datepicker();
	});
	
function downloadReport()
{
  	$.get('prepareReport.do',{order_duedate: $("#datepicker_order")[0].value, sample_duedate: $("#datepicker_sample")[0].value, targetprice: $("#sampleNoteReport_targetprice")[0].value, sample_units: $("#sampleNoteReport_sample_units")[0].value}
	, function (data) {
		if (data != undefined && data != null && data.error !="true")
		{
			downloadUrl(data.url);		
		}
	});
}

function downloadUrl(url)
{
    var iframe;
    iframe = document.getElementById("hiddenDownloader");
    if (iframe == undefined)
    {
        iframe = document.createElement('iframe');  
        iframe.id = "hiddenDownloader";
        iframe.style.visibility = 'hidden';
        document.body.appendChild(iframe);
    }
    iframe.src = url;   
}

</SCRIPT> 
</html>